<?php

function smarty_function_captcha($params, &$smarty)
{
	if (!isset($params['input']))
	{
		return '';
	}

	$sJs = "onmouseover=\"showInfo5('" . App::format('Mod_Account.display_new_code') . "', '', '');\" onmouseout=\"return nd();\"";
	$sStr = '<img src="' . App::makeUrl('public.randimage', array('r' => md5(rand(100, 1000)))) . '" ' . $sJs . ' onclick="xajax_randomCaptcha(\'captcha_image\', \'' . $params['input'] . '\');" id="captcha_image" alt="" style="cursor:pointer; vertical-align:middle;" />';
	$sStr .= ' <img src="design/pic/reload.gif" ' . $sJs . ' alt="" style="vertical-align:middle; cursor:pointer;" onclick="xajax_randomCaptcha(\'captcha_image\', \'' . $params['input'] . '\');" /> ';

	return $sStr;
}

?>